home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v9n20.arc
/
MK4_UD2.XTS
< prev
next >
Wrap
Text File
|
1990-10-29
|
4KB
|
114 lines
/*
MK4_UD2.XTS
PC MagNet Utilities Database
prompt driven down load script
by Rick Ayre, 6.8.90
*/
i = 0 -- Declare variables
string choice, dload, dFile[30], more -- and values where needed
if online then reply "Script can only be run while you are off-line!" : end
-- This if clause ends the script if it is invoked while on line
label get_name -- Routine to prompt for file names
repeat -- using a repeat until done loop
i = i + 1 -- and showing off Xtalk's window and form functions
w = freewin
window w, at 9,11 size 4,58 color bright white on yellow
defwindow = w
Title " File down load from PC MagNet Utilities Database "
form start
print
print " Filename from MagNet: ";
r = ypos
c = xpos
field dload at r,c width 12 allUC, reset
form accept
if null(dload) then gosub what_now -- If clause to handle "ESC" and "ENTER" and like that
if exists (dload) then { -- Check to see if file exits already
clear
print "This file already exists:",dload
print "Get others? (Y/N)" -- If it does
input choice -- inquire as to how to proceed
if choice = "n" then end -- if user answers NO, end script
i = i - 1 -- otherwise dump file
clear -- clear window
goto get_name -- and start again
}
form start
print
print " Download another (Y/N): ";
r = ypos
c = xpos
field more at r,c width 1 allUC, reset
form accept
dfile[i] = dload -- Load file names into file array
until more = "N"
label call_magnet -- Routine to dial and log on
if null(dload) then end --end script if no files are named
load "CSERVE" -- Either name your dialing entry CSERVE or enter yours here
protocol "CSERVEB"
call "CSERVE" -- <== Same here
wait 20 ticks,
reply
wait for "Host Name:",
reply "CIS"
wait for "User ID:",
reply "#####,###" -- Your UserID replaces "#"s
wait for "Password:",
display off
reply "*****.*******" -- Your Password replaces "*"s
wait 5 seconds for space chr(13),
display on
repeat -- Loop to load file string from file array
my_file = dFile[i]
gosub get_file -- Jump to routine that down loads files
i = i - 1 -- Decrement file array counter
until i = 0 -- Until array is empty
wait quiet 5 seconds : reply "OFF" -- Quit MagNet
wait for "Host Name:" : BYE : end -- Hang up phone and end script
label get_file -- Routine to down load files
wait quiet 5 seconds,
reply "go pcm:utilit"
wait for "!",
reply "4"
wait for "e (example, DR.COM):",
reply my_file
watch for -- This watch for traps responses when
"ad this file? (Y/N)" : reply "y" -- file name is mispelled or ambiguous
"!" : goto no_file -- and jumps to a routine to recover
endwatch
wait for "> to begin transfer!",
wait quiet 5 ticks,
Reply
wait for "!",
reply "5"
/* --If you are running Mk.4 v1.X you must uncomment the "if filter" line
if filter = 'CONTROL' then fmap = fmap | 65568
*/ --To uncomment the above line simple delete the "/*" and the "*/"
wait quiet 5 seconds,
return
label no_file -- Routine to recover from on line errors
clear
print "File not found!"
print "Continue with others? (Y/N)"
input choice
if choice = "n" then end
shut
return
label what_now -- Routine to recover from off line errors
clear
print "Do you want to Quit (Y/N):";
input choice
if choice = "y" then end
clear
i = i - 1
return